var app=getApp();
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    id:{
      "type":String
    },
    item:{
      "type":Object,
      "value":{
        commentText:"好",
        showAction:"展示中",
        commentDate:"2024-01-01",
        foodName:"默认菜名",
        canteenName:"默认饭堂",
        rating:4,
      }

    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    delComment(){
      wx.showModal({
        title: '再次确认',
        content: '是否删除该评论',
        complete: (res) => {
          if (res.confirm) {
            wx.request({
              url: app.globalData.apiUrl+'/comment/deleteCommentByCommentId',
              method:"POST",
              data:{
                "token":wx.getStorageSync('token'),
                "commentID":parseInt(this.id)
              },
              success:(res)=>{
                // console.log(res);
                this.triggerEvent("reLoadComment");
              }
            })
          }
        }
      })
    }
  }
})